﻿DROP DATABASE IF EXISTS `iars`;
CREATE DATABASE `iars` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `iars`;

DROP TABLE IF EXISTS `tbl_ar`;
CREATE TABLE `tbl_ar` (
  `IDAudit` int(11) NOT NULL AUTO_INCREMENT,
  `Goal` varchar(100) DEFAULT NULL,
  `DateStart` date DEFAULT NULL,
  `DateFinish` date DEFAULT NULL,
  `Nature` varchar(100) DEFAULT NULL,
  `Description` varchar(100) DEFAULT NULL,
  `Requestor` varchar(100) DEFAULT NULL,
  `RequestorSector` varchar(50) DEFAULT NULL,
  `RequestorPhone` varchar(50) DEFAULT NULL,
  `AuditLocation` varchar(250) DEFAULT NULL,
  `StartDate` date DEFAULT NULL,
  `AudirDate` date DEFAULT NULL,
  `PersonAuditee` varchar(50) DEFAULT NULL,
  `ChiefAuditor` varchar(50) DEFAULT NULL,
  `EmailRequestor` varchar(100) DEFAULT NULL,
  `NameOfAuditor1` varchar(50) DEFAULT NULL,
  `NameOfAuditor2` varchar(50) DEFAULT NULL,
  `SectorInvolved` varchar(250) DEFAULT NULL,
  `AuditType` varchar(50) DEFAULT NULL,
  `MainGoal` varchar(50) DEFAULT NULL,
  `CoverageArea` varchar(50) DEFAULT NULL,
  `Results` varchar(50) DEFAULT NULL,
  `ProblemasFound` varchar(50) DEFAULT NULL,
  `Recomendations` varchar(50) DEFAULT NULL,
  `Schedule` varchar(50) DEFAULT NULL,
  `Legislation` varchar(50) DEFAULT NULL,
  `Observations` varchar(50) DEFAULT NULL,
  `Photo1` varchar(50) DEFAULT NULL,
  `Photo2` varchar(50) DEFAULT NULL,
  `PATH_Photos` varchar(50) DEFAULT NULL,
  `LogArchived` text,
  PRIMARY KEY (`IDAudit`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `tbl_rc`;
CREATE TABLE `tbl_rc` (
  `IDCompliance` int(11) NOT NULL AUTO_INCREMENT,
  `Description` varchar(100) DEFAULT NULL,
  `ComplianceType` varchar(50) DEFAULT NULL,
  `Status` varchar(50) DEFAULT NULL,
  `ManufacturerInTheCountry` varchar(50) DEFAULT NULL,
  `SupportAvailable` varchar(50) DEFAULT NULL,
  `LanguageDocumentation` varchar(50) DEFAULT NULL,
  `StartDate` date DEFAULT NULL,
  `FinishDate` date DEFAULT NULL,
  `DateOfCompliance` varchar(50) DEFAULT NULL,
  `GenerateAccessLog` varchar(50) DEFAULT NULL,
  `UsageLog` varchar(50) DEFAULT NULL,
  `AccessControl` varchar(50) DEFAULT NULL,
  `PermissionControl` varchar(50) DEFAULT NULL,
  `Acessible` varchar(50) DEFAULT NULL,
  `Dependencies` varchar(50) DEFAULT NULL,
  `CompliesWithRequirements` varchar(50) DEFAULT NULL,
  `RequestedBy` varchar(50) DEFAULT NULL,
  `AprovedBy` varchar(50) DEFAULT NULL,
  `TestedBy` varchar(50) DEFAULT NULL,
  `EvaluatedVersion` varchar(50) DEFAULT NULL,
  `FinalResult` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`IDCompliance`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `tbl_si`;
CREATE TABLE `tbl_si` (
  `IDIncident` int(11) NOT NULL AUTO_INCREMENT,
  `IdEquipment` int(11) DEFAULT NULL,
  `Description` varchar(100) DEFAULT NULL,
  `WhoNotifies` varchar(50) DEFAULT NULL,
  `EmployeeName` varchar(50) DEFAULT NULL,
  `Phone` varchar(50) DEFAULT NULL,
  `Ext` varchar(50) DEFAULT NULL,
  `Cel` varchar(50) DEFAULT NULL,
  `Email` varchar(100) DEFAULT NULL,
  `OccurrenceTime` time DEFAULT NULL,
  `OccurrenceDate` date DEFAULT NULL,
  `IncidentNature` varchar(100) DEFAULT NULL,
  `HowWasDetected` varchar(100) DEFAULT NULL,
  `ImmediateImpact` varchar(50) DEFAULT NULL,
  `QuantityOfHostAffected` int(11) DEFAULT NULL,
  `HWCompromissed` varchar(100) DEFAULT NULL,
  `SWCompromissed` varchar(100) DEFAULT NULL,
  `IP` varchar(250) DEFAULT NULL,
  `MAC` varchar(50) DEFAULT NULL,
  `NetworkType` varchar(50) DEFAULT NULL,
  `MODEM` varchar(50) DEFAULT NULL,
  `NumeroMODEM` varchar(50) DEFAULT NULL,
  `HostPhyscalLocation` varchar(50) DEFAULT NULL,
  `FacilityCecurityCompromised` varchar(50) DEFAULT NULL,
  `MainUser` varchar(100) DEFAULT NULL,
  `StatusNow` varchar(50) DEFAULT NULL,
  `Virus` varchar(50) DEFAULT NULL,
  `SourceAddress` varchar(250) DEFAULT NULL,
  `AttackSource` varchar(100) DEFAULT NULL,
  `ActiveConnection` varchar(50) DEFAULT NULL,
  `KeyLogger` varchar(50) DEFAULT NULL,
  `Sniffer` varchar(50) DEFAULT NULL,
  `IntactLogs` varchar(50) DEFAULT NULL,
  `UnderAttack` varchar(50) DEFAULT NULL,
  `RemoteAccessAttack` varchar(50) DEFAULT NULL,
  `FirewallCompromised` varchar(50) DEFAULT NULL,
  `AntiVirusOutDated` varchar(50) DEFAULT NULL,
  `DoNotCommentWith` varchar(50) DEFAULT NULL,
  `ActionsTaken` varchar(250) DEFAULT NULL,
  `OtherUsersInvolved` varchar(250) DEFAULT NULL,
  `Risks` int(11) DEFAULT NULL,
  `Severity` int(11) DEFAULT NULL,
  `Urgency` int(11) DEFAULT NULL,
  `Complexity` int(11) DEFAULT NULL,
  `Impact` int(11) DEFAULT NULL,
  `DetailedDescription` text,
  `ScreenCapture` longblob,
  `PATHScreenCapture` varchar(50) DEFAULT NULL,
  `OngoingActivities` varchar(250) DEFAULT NULL,
  `Log` text,
  PRIMARY KEY (`IDIncident`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


DROP TABLE IF EXISTS `tbl_sop`;
CREATE TABLE `tbl_sop` (
  `IDSOP` int(11) NOT NULL AUTO_INCREMENT,
  `Description` varchar(45) DEFAULT NULL,
  `Data` date DEFAULT NULL,
  `Author` varchar(50) DEFAULT NULL,
  `NextRevisionDate` date DEFAULT NULL,
  `Version` varchar(50) DEFAULT NULL,
  `Subject` varchar(100) DEFAULT NULL,
  `Object` varchar(100) DEFAULT NULL,
  `Enforcement` varchar(100) DEFAULT NULL,
  `Procedures` text,
  `TargetUsers` varchar(250) DEFAULT NULL,
  `IssuedBy` varchar(50) DEFAULT NULL,
  `RevisedByEmployee` varchar(50) DEFAULT NULL,
  `AprovedByManager` varchar(50) DEFAULT NULL,
  `Diagram` longblob,
  `PathToDiagram` varchar(250) DEFAULT NULL,
  `Observation` text,
  `RevisionHistori` text,
  `Attachments` text,
  PRIMARY KEY (`IDSOP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

